<?php
require_once("sys_image_handle.class.php");

//任务，生成缩略图

for($i=1;$i<3;$i++)
{
    $rdsum_k = md5(rand(0,9999));
    $rdsum = substr($rdsum_k,17,5);
    $rdsumo.= $rdsum;
}
$hvlemkcode =  substr($rdsumo,"", -1);

$filename="userico_".time()."_".$hvlemkcode;

//生成图片3个规格
if (!empty($GLOBALS["HTTP_RAW_POST_DATA"]))
{
  $jpg = $GLOBALS["HTTP_RAW_POST_DATA"];
  header("Content-Type: image/jpeg");
  $file = fopen("img/".$filename."_big.jpg","w");
  fwrite($file,$jpg);
  fclose($file);
}

$njpg = imagecreatefromjpeg("img/".$filename."_big.jpg");

resizeImage($njpg,75,89,"img/".$filename."_middle",".jpg");
resizeImage($njpg,50,59,"img/".$filename."_small",".jpg");


?>